<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="lijinbo" />
    <title>016-css弹跳loading</title>
    <style>
      .box {
        position: relative;
      }

      .box:before {
        content: '';
        position: absolute;
        z-index: 2;
        top: 60px;
        left: 50px;
        width: 50px;
        height: 50px;
        background: #c00;
        border-radius: 2px;
        transform: rotate(45deg);
        animation: box 0.4s infinite;
      }

      @keyframes box {
        0% {
          top: 50px;
          transform: rotate(90deg);
        }

        20% {
          border-radius: 2px;
        }

        50% {
          top: 80px;
          transform: rotate(45deg);
          border-bottom-right-radius: 25px;
        }

        80% {
          border-radius: 2px;
        }

        100% {
          top: 50px;
          transform: rotate(0deg);
        }
      }

      .box:after {
        content: '';
        position: absolute;
        z-index: 1;
        top: 128px;
        left: 52px;
        width: 44px;
        height: 3px;
        background: #eaeaea;
        border-radius: 100%;
        animation: shadow 0.4s infinite;
      }

      @keyframes shadow {
        0%,
        100% {
          left: 54px;
          width: 40px;
          background: #eaeaea;
        }

        50% {
          top: 126px;
          left: 50px;
          /*让阴影保持在原位*/
          width: 50px;
          height: 7px;
          background: #eee;
        }
      }
    </style>
  </head>

  <body>
    <div class="box"></div>
    <p>
      <a href="https://cssloaders.github.io/" target="_blank">更多css加载动画：cssloaders.github.io</a>
    </p>
  </body>
</html>
